﻿using System;
using Microsoft.SharePoint;

namespace CodeCounsel.SharePoint.NavigationService
{
    public class NavigationManager
    {
        public SPServiceContext Context { get; private set; }

        public NavigationManager(SPServiceContext context)
        {
            Context = context;
        }

        public string GetNavigationInformation()
        {
            using (SPServiceContextScope scope = new SPServiceContextScope(Context))
            {
                NavigationApplicationProxy proxy = NavigationApplicationProxy.GetProxy(Context);
                return proxy.GetNavigationInformation();
            }
        }
    }
}
